-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow storage wrappers to through a forbidden exception with retry information for clients #20494
Conversation
@@ -235,6 +237,8 @@ public function move($sourcePath, $destinationPath) { | |||
} | |||
} catch (StorageNotAvailableException $e) { | |||
throw new \Sabre\DAV\Exception\ServiceUnavailable($e->getMessage()); | |||
} catch (ForbiddenException $ex) { | |||
throw new Forbidden($ex->getMessage(), $ex->getRetry()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this DAVForbiddenException
everywhere to avoid confusion ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really sure it helps a lot. DAV could still be the app or sabre...
Code looks good otherwise 👍 |
* @return int | ||
*/ | ||
public function getHTTPCode() { | ||
return 403; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like the perfect use case for HTTP 451: Unavailable For Legal Reasons
😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to overload - base already implements this as 403
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I didn't extend in the beginning, so this was just a left over. will fix in a minute
👍 looks good |
I'm missing tests 👿 |
4b2a8db
to
0ab8a4c
Compare
0ab8a4c
to
e2cfcd9
Compare
@DeepDiver1975 added some tests to the dav stuff to test exception convertion and exception serialization |
Allow storage wrappers to through a forbidden exception with retry information for clients
Current response on webdav requests:
@DeepDiver1975 @icewind1991
Required for FW storage wrapper.
Currently reason === exception message, not sure if we want to keep it like that, but for now that should be fine so we can continue the actual work.